package com.levine.base_libs.entity;

import com.chad.library.adapter.base.entity.MultiItemEntity;

/**
 * 基础数据包装类，用于baseRVAdapter数据类型的包装
 */
public class BaseME implements MultiItemEntity {
    /**
     * 适配器item类型，根据包装的类型获取对应的数据及item数据的填充，类型不够自己加
     */
    public static final int TYPE_1 = 1;
    public static final int TYPE_2 = 2;
    public static final int TYPE_3 = 3;
    public static final int TYPE_4 = 4;
    public static final int TYPE_5 = 5;
    public static final int TYPE_6 = 6;
    public static final int TYPE_7 = 7;
    public static final int TYPE_8 = 8;
    public static final int TYPE_9 = 9;
    public static final int TYPE_10 = 10;

    private boolean isCheck = false;
    private int type = -1;//根据type判断item的类型

    private Object data;

    public BaseME(int type) {
        this.type = type;
    }

    /**
     * @param type item类型
     * @param data 数据，注意：在适配器中获取数据的时候需根据对应包装的数据类型进行强转
     */
    public BaseME(int type, Object data) {
        this.type = type;
        this.data = data;
    }

    @Override
    public int getItemType() {
        return type;
    }

    public Object getData() {
        return data;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }
}
